This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
Mark, I see this under "Initialize." The agent is set to Auto.
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim holdoc As notesdocument
Dim nextdoc As Notesdocument
Dim tmpdt As New NotesDateTime("")
Dim purgedate As New NotesDateTime ("Today")
Dim n As Integer
Dim StartDate As Variant
Dim OkToPurge As Integer
Dim profile As NotesDocument
Dim nextProfDoc As NotesDocument
Dim ProfileDoc As NotesDocument
Dim dcMemo As NotesDocumentCollection
Dim docMemo As NotesDocument
Set db=s.CurrentDatabase
'need to process docs with form="Notice" the same way as docs with form="Reservation"
Set dc=db.UnprocessedSearch("@Contains(Form;""Reservation"") | @Contains(Form;""Notice"")", tmpdt,0)
Set dcMemo=db.UnprocessedSearch("@Contains(Form;""Memo"")", tmpdt,0)
' to remove all docs with form="Memo" from db
Set docMemo = dcMemo.GetFirstDocument
For j=1 To dcMemo.count
Set holddoc=dcMemo.GetNextdocument(docMemo)
If Not(docMemo Is Nothing) Then docMemo.Remove (True)
Set docMemo = holddoc
Next
' to remove all profile docs with no "$Busyname"
Set dcProf= db.GetProfileDocCollection("CalendarProfile")
Set ProfileDoc = dcProf.GetFirstDocument
For i=1 To dcProf.count
Set nextProfDoc=dcProf.GetNextdocument(ProfileDoc)
If Not(ProfileDoc.HasItem("$BusyName")) Then ProfileDoc.Remove (True)
Set ProfileDoc = nextProfDoc
Next
Call purgedate.AdjustDay (-2)
Set doc=dc.GetFirstDocument
While Not (doc Is Nothing)
'If document is blockerdoc skip
If doc.HasItem("$CSBlocker") Then Goto donextdocument
If doc.HasItem("$NoPurge") And Not(Isempty(doc.GetItemValue("$NoPurge")(0))) Then
Dim tmpNoPurge As New NotesDateTime(doc.GetItemValue("$NoPurge")(0))
If tmpNoPurge.IsValidDate And tmpNoPurge.DateOnly <>"" Then
StartDate=doc.GetitemValue("$NoPurge")
Else
If doc.HasItem("StartDateTime") Then
StartDate=doc.GetitemValue("StartDateTime")
Else
OKToPurge=True
End If
End If
Else
If doc.HasItem("StartDateTime") Then
StartDate=doc.GetitemValue("StartDateTime")
Else
OKToPurge=True
End If
End If
If Not(Isempty(StartDate)) Then
Forall eachstartdate In StartDate
Dim tmpstartdate As New NotesDateTime(eachstartdate)
If tmpstartdate.IsValidDate Then
If purgedate.TimeDifference(tmpstartdate)>0 Then
Feedback response number WEBB8GRJN5 created by ~Delores Lopgeroverakol on 05/11/2011